home *** CD-ROM | disk | FTP | other *** search
/ Shareware Extravaganza - Disc 4 / Shareware Extravaganza - Over 25,000 Programs (The Ultimate Shareware Company)(Disc 4 of 4)(1993).iso / cad / quikcmd2.zip / FASTCALC.LSP < prev    next >
Text File  |  1990-10-23  |  5KB  |  128 lines

  1. ;  FASTCALC.LSP
  2. ;
  3. ;                         QUICK COMMAND version 2.0
  4. ;                   FASTCALC.LSP is a module of QUICK COMMAND
  5. ;                        Copyright 1989, 1990 Dan Jincks
  6. ;
  7. ;
  8. ;              This is SHAREWARE, it is NOT Public Domain software.
  9. ;
  10. ;              This code or any part of this code may not be reproduced
  11. ;              in any publication without prior written permission.
  12. ;
  13. ;              Printed copy of this code or any part of this code may not
  14. ;              be distributed without prior written permission.
  15. ;
  16. ;              Printed copy may only be made for reference purposes by
  17. ;              the end user.
  18. ;
  19. ;
  20. ;                               Dan Jincks
  21. ;                             Box 155A HCR 77
  22. ;                           Annapolis, MO 63620
  23. ;
  24. ;
  25. ;
  26. ;   You are granted a limited license to use FASTCALC.LSP for a 30 day trial
  27. ;   period.  If you wish to continue using any or all of QUICK COMMAND after
  28. ;   the trial period, you must become a registered user.  As a registered
  29. ;   user, you may use QUICK COMMAND on 1 workstation or terminal.
  30. ;   Additional registrations must be bought for each additional workstation or
  31. ;   terminal.  To become a registered user, fill out the order form that can
  32. ;   be printed out from ORDERQC.DOC .
  33. ;
  34. ;
  35. ;   You may send copies of QUICK COMMAND to friends and associates if you abide
  36. ;   by the following rules:
  37. ;
  38. ;   1. It may only be distributed in the original unmodified form.
  39. ;   2. All original files must be included.
  40. ;   3. No addition files may be added.
  41. ;   4. If other files will be on the same disk, QUICK COMMAND files must be in
  42. ;      a library format such as ".ARC" called "QUICKCMD", or else be put alone
  43. ;      in a subdirectory called "QUICKCMD".
  44. ;   5. You may not sell QUICK COMMAND or any part of it.
  45. ;   6. You are not allowed to charge more then $5 to cover the cost of copying
  46. ;      and distribution.
  47. ;   7. You may not distribute any hard copy of the contents of QUICK COMMAND.
  48. ;
  49. ;
  50. ;   These AutoLISP commands and functions are designed to save you time, and
  51. ;   saving time means saving money.  The registration fee is very modest
  52. ;   compared to the savings, and much less expensive then typical third party
  53. ;   AutoCAD software. Be sure to registar if you continue to use them.
  54. ;
  55. ;
  56. ;                                                               DAN
  57. ;
  58. ;
  59. ;
  60. ;
  61. ;        AutoCAD and AutoLISP are registered trade marks of Autodesk Inc.
  62. ;
  63. ;        ***************************************************************
  64. ;
  65. ;   Begin FASTCALC.LSP
  66. ;
  67. (defun C:CA ()(CA))
  68. (defun CA (/ SCA SCB SCC SCF)
  69.    (prompt "                   Calculator !!!   ")(terpri)
  70.    (prompt " ")(terpri)
  71.    (if (/= ANS nil)(progn
  72.       (prompt "Start with previous answer:  ")(prin1 ANS)(prompt " ?       ")
  73.       (initget "Yes No")
  74.       (setq SCB (getkword " Yes/No <No>  "))))(terpri)
  75.    (if (or (= SCB "No")(= SCB nil))(progn
  76.       (initget (+ 1 2))
  77.       (setq ANS (getdist "Enter first number or distance:   "))))
  78.    (setq SCF 0)
  79.    (while (/= SCF nil)(progn
  80.       (prompt " ")(terpri)
  81.       (prin1 ANS)
  82.       (initget "Add Subtract Multiply Divide SQuareroot + * - /")
  83.       (setq SCF
  84.          (getkword "           Add/Subtract/Multiply/Divide/SQuareroot   "))
  85.       (terpri)
  86.       (if (or (= SCF "Add")(= SCF "+"))(progn
  87.          (setq SCA ANS)(prin1 SCA)
  88.          (initget  (+ 1 2))
  89.          (setq SCC (getdist " + ? "))(terpri)
  90.          (setq ANS (+ ANS SCC))(prin1 SCA)(prompt" + ")(prin1 SCC)(prompt" = ")
  91.          (prin1 ANS)(terpri)
  92.          )
  93.       )
  94.       (if (or (= SCF "Subtract")(= SCF "-"))(progn
  95.          (setq SCA ANS)(prin1 SCA)
  96.          (initget (+ 1 2))
  97.          (setq SCC (getdist " - ? "))(terpri)
  98.          (setq ANS (- ANS SCC))(prin1 SCA)(prompt" - ")(prin1 SCC)(prompt" = ")
  99.          (prin1 ANS)(terpri)
  100.          )
  101.       )
  102.       (if (or (= SCF "Multiply")(= SCF "*"))(progn
  103.          (setq SCA  ANS)(prin1 SCA)
  104.          (initget (+ 1 2))
  105.          (setq SCC (getdist " * ? "))(terpri)
  106.          (setq ANS (* ANS SCC))(prin1 SCA)(prompt" * ")(prin1 SCC)(prompt" = ")
  107.          (prin1 ANS)(terpri)
  108.          )
  109.       )
  110.       (if (or (= SCF "Divide")(= SCF "/"))(progn
  111.          (setq SCA  ANS)(prin1 SCA)
  112.          (initget (+ 1 2))
  113.          (setq SCC (getdist " / ? "))(terpri)
  114.          (setq ANS (/ ANS SCC))(prin1 SCA)(prompt" / ")(prin1 SCC)(prompt" = ")
  115.          (prin1 ANS)(terpri)
  116.          )
  117.       )
  118.       (if (and (> ANS 0) (= SCF "SQuareroot"))(progn
  119.          (setq SCA ANS)
  120.          (setq ANS (sqrt ANS ))(prompt"Squareroot of ")(prin1 SCA)(prompt" = ")
  121.          (prin1 ANS)(terpri)
  122.          )
  123.       )
  124.    ))(princ)
  125. )
  126. ;
  127. ;   End FASTCALC.LSP
  128.